package com.hcz.entity;

import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

public class EmailTest {

	public static void main(String[] args) {
		Email e = new SimpleEmail();
		
		e.setHostName("smtp.qq.com");
		e.setAuthentication("1459471293", "hcz755853599");
		e.setCharset("UTF-8");
		e.setTLS(true);
		
		try {
			e.setFrom("1459471293@qq.com");
			e.setSubject("6.1快乐");
			e.setMsg("commons email");
			e.addTo("804933522@qq.com");
			e.send();
		} catch (EmailException e1) {
			e1.printStackTrace();
		}
		
	}
	
	
	
}
